#pragma once

#include "dut/WinMin.h"
#include "dut/Texture2D.h"
#include "glm/glm.hpp"


namespace Dut
{

	struct RenderTarget
	{
		std::vector<Dut::Texture2D> m_Textures;
		Dut::Texture2D m_depthStencilTexture;

		struct Desc
		{
			unsigned int m_NumTextures;
			unsigned int m_Width;
			unsigned int m_Height;
			DXGI_FORMAT m_Format = DXGI_FORMAT_R8G8B8A8_UNORM;

			glm::vec4 m_BackgroundColor;

		} m_Desc;

		ComPtr<ID3D11Texture2D> m_pDepthStencilBuffer;				
		std::vector<ComPtr<ID3D11RenderTargetView>> m_pRenderTargetViews;			
		ComPtr<ID3D11DepthStencilView> m_pDepthStencilView;			
		D3D11_VIEWPORT m_ScreenViewport;                            

		HRESULT Create(ID3D11Device* device, const Desc& desc);
		void Begin(ID3D11DeviceContext* context);
		static void UnBind(ID3D11DeviceContext* context);
		void OnResize(ID3D11Device* device);


		std::vector<ID3D11RenderTargetView*> GetRenderTargetViews();
	};
}